/*********************************************
 * Copyright (c) 2009 ICBC.
 * All rights reserved.
 * Created on 2010-6-16 14:33:11
 * 
 * Contributors:
 *     ctp - initial implementation
 *********************************************/
package com.icbc.ctpdemo.personal;
/**
 * 快捷菜单定制类.
 * 
 * <pre>
 *  用于展现当前用户可定制的快捷菜单
 * </pre>
 * 
 * @author kfzx-liukai
 * 
 */
public class MenuShortCutBean {
	private String menuId;// 菜单ID
	private String menuLabel;// 菜单标签
	private String menuParentId;// 菜单父节点ID
	private String menuLevel;//菜单层级
	private String flag;//菜单类别（1代表菜单，0代表未选中功能，2代表选中功能）
	private String url;//菜单路径
	private String selected;//菜单选择框
	private String self;//菜单和其父节点ID
	
	public String getSelf() {
		if("1".equals(flag))
		{
			return menuId;
		}
		else 
		{
			return menuId+menuParentId;
		}
	}
	public void setSelf(String self) {
		this.self = self;
	}
	public String getSelected() {
		if ("1".equals(flag.toString())){
			return "";
		}
		else if ("0".equals(flag.toString())){
			return "<div align='center'><input type='checkbox' id='itemId' name='itemId' value='"+menuId+"'/></div>";
		}
		else{
			return "<div align='center'><input type='checkbox' id='itemId' name='itemId' value='"+menuId+"' checked/></div>";
		}
	}
	public void setSelected(String selected) {
		this.selected = selected;
	}
	
	public String getMenuId() {
		return menuId;
	}
	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}
	public String getMenuLabel() {
		return menuLabel;
	}
	public void setMenuLabel(String menuLabel) {
		this.menuLabel = menuLabel;
	}
	public String getMenuParentId() {
		return menuParentId;
	}
	public void setMenuParentId(String menuParentId) {
		this.menuParentId = menuParentId;
	}
	public String getMenuLevel() {
		return menuLevel;
	}
	public void setMenuLevel(String menuLevel) {
		this.menuLevel = menuLevel;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("menuId=");
		sb.append(menuId);
		sb.append(" menuLabel=");
		sb.append(menuLabel);
		sb.append(" menuParentId=");
		sb.append(menuParentId);
		sb.append(" menuLevel=");
		sb.append(menuLevel);
		sb.append(" flag=");
		sb.append(flag);
		sb.append(" url=");
		sb.append(url);
		sb.append(" selected=");
		sb.append(selected);
		sb.append(" self=");
		sb.append(self);
		return sb.toString();
	}
}
